package b.i.b;

import android.app.Activity;
import android.content.pm.PackageManager;
import android.os.Build.VERSION;
import android.os.Handler;
import android.os.Looper;

/* compiled from: ActivityCompat */
public class a extends b.i.c.a {
    public static final /* synthetic */ int b = 0;

    /* compiled from: ActivityCompat */
    public class a implements Runnable {
        public final /* synthetic */ String[] a;
        public final /* synthetic */ Activity b;
        public final /* synthetic */ int c;

        public a(String[] strArr, Activity activity, int i) {
            this.a = strArr;
            this.b = activity;
            this.c = i;
        }

        public void run() {
            int[] iArr = new int[this.a.length];
            PackageManager packageManager = this.b.getPackageManager();
            String packageName = this.b.getPackageName();
            int length = this.a.length;
            for (int i = 0; i < length; i++) {
                iArr[i] = packageManager.checkPermission(this.a[i], packageName);
            }
            ((b) this.b).onRequestPermissionsResult(this.c, this.a, iArr);
        }
    }

    /* compiled from: ActivityCompat */
    public interface b {
        void onRequestPermissionsResult(int i, String[] strArr, int[] iArr);
    }

    /* compiled from: ActivityCompat */
    public interface c {
        void b(int i);
    }

    public static void c(Activity activity, String[] strArr, int i) {
        if (VERSION.SDK_INT >= 23) {
            ((c) activity).b(i);
            activity.requestPermissions(strArr, i);
            return;
        }
        new Handler(Looper.getMainLooper()).post(new a(strArr, activity, i));
    }
}
